package com.zhike.common.conf;

import org.springframework.stereotype.Component;
import org.springframework.beans.factory.annotation.Value;
import com.eva.epc.common.util.CommonUtils;

import lombok.Data;

@Component
@Data
public class IMBaseConf {

  @Value("${NODE_NAME}")
  private String NODE_NAME;

  public String getNODE_NAME() {
    return NODE_NAME;
  }

  @Value("${DIR_USER_AVATAR_UPLOAD: default_value}")
  private String DIR_USER_AVATAR_UPLOAD;

  public String getDIR_USER_AVATAR_UPLOAD() {
    return DIR_USER_AVATAR_UPLOAD;
  }

  @Value("${DIR_USER_FONT_DIR: default_value}")
  private String DIR_USER_FONT_DIR;

  public String getDIR_USER_FONT_DIR() {
    return DIR_USER_FONT_DIR;
  }

  @Value("${DIR_USER_AVATARGROUP_DIR: default_value}")
  private String DIR_USER_AVATARGROUP_DIR;

  public String getDIR_USER_AVATARGROUP_DIR() {
    return DIR_USER_AVATARGROUP_DIR;
  }

  @Value("${DIR_USER_UPLOAD: default_value}")
  private String DIR_USER_UPLOAD;

  public String getDIR_USER_UPLOAD() {
    return DIR_USER_UPLOAD;
  }

  @Value("${IM_FILE_DOMAIN: default_value}")
  private String IM_FILE_DOMAIN;

  public String getIM_FILE_DOMAIN;

  @Value("${DIR_USER_BIGFILE_UPLOAD: default_value}")
  private String DIR_USER_BIGFILE_UPLOAD;

  public String getDIR_USER_BIGFILE_UPLOAD() {
    return DIR_USER_BIGFILE_UPLOAD;
  }

  @Value("${IM_BRIDGE_ENABLED: false}")
  private Boolean IM_BRIDGE_ENABLED;

  public boolean getIM_BRIDGE_ENABLED() {
    return IM_BRIDGE_ENABLED;
  }

  @Value("${IM_BRIDGE_MQ_URI: default_value}")
  private String IM_BRIDGE_MQ_URI;

  public String getIM_BRIDGE_MQ_URI() {
    return IM_BRIDGE_MQ_URI;
  }

  @Value("${IM_SERVER_UDP_LISTENNING_PORT:9903}")
  private String IM_SERVER_UDP_LISTENNING_PORT;

  public int getIM_SERVER_UDP_LISTENNING_PORT() {
    return CommonUtils.getIntValue(IM_SERVER_UDP_LISTENNING_PORT, 9903);
  }

  @Value("${IM_SERVER_TCP_LISTENNING_PORT:9903}")
  private String IM_SERVER_TCP_LISTENNING_PORT;

  public int getIM_SERVER_TCP_LISTENNING_PORT() {
    return CommonUtils.getIntValue(IM_SERVER_TCP_LISTENNING_PORT, 9903);
  }

  @Value("${IM_SERVER_WEBSOCKET_LISENNING_PORT:3000}")
  private String IM_SERVER_WEBSOCKET_LISENNING_PORT;

  public int getIM_SERVER_WEBSOCKET_LISENNING_PORT() {
    return CommonUtils.getIntValue(IM_SERVER_WEBSOCKET_LISENNING_PORT, 3000);
  }

  /**
   * 设置服务端支持UDP协议
   */
  @Value("${IM_SERVER_UDP_SUPPORT: false}")
  private Boolean IM_SERVER_UDP_SUPPORT;

  public boolean getIM_SERVER_UDP_SUPPORT() {
    return IM_SERVER_UDP_SUPPORT;
  }

  /**
   * 设置服务端支持TCP协议
   */
  @Value("${IM_SERVER_TCP_SUPPORT: false}")
  private Boolean IM_SERVER_TCP_SUPPORT;

  public boolean getIM_SERVER_TCP_SUPPORT() {
    return IM_SERVER_TCP_SUPPORT;
  }

  /**
   * 设置服务端支持Websocket协议
   */
  @Value("${IM_SERVER_WEBSOCKET_SUPPORT: false}")
  private Boolean IM_SERVER_WEBSOCKET_SUPPORT;

  public boolean getIM_SERVER_WEBSOCKET_SUPPORT() {
    return IM_SERVER_WEBSOCKET_SUPPORT;
  }

  /**
   * 设置ZK服务
   */
  @Value("${IM_SERVER_ZK_SUPPORT: false}")
  private Boolean IM_SERVER_ZK_SUPPORT;

  public boolean getIM_SERVER_ZK_SUPPORT() {
    return IM_SERVER_ZK_SUPPORT;
  }

  @Value("${IM_SERVER_ZK_HOST}")
  private String IM_SERVER_ZK_HOST;

  public String getIM_SERVER_ZK_HOST() {
    return IM_SERVER_ZK_HOST;
  }

  /**
   * 日志开关-发送
   */
  @Value("${IM_SEND_DEBUG_ENABLED: false}")
  private Boolean IM_SEND_DEBUG_ENABLED;

  public boolean getIM_SEND_DEBUG_ENABLED() {
    return IM_SEND_DEBUG_ENABLED;
  }

  /**
   * 日志开关-接收
   */
  @Value("${IM_RECIVE_DEBUG_ENABLED: false}")
  private Boolean IM_RECIVE_DEBUG_ENABLED;

  public boolean getIM_RECIVE_DEBUG_ENABLED() {
    return IM_RECIVE_DEBUG_ENABLED;
  }

  @Value("${AUTO_TIMING_RESTORE_MESSAGES_INTERVAL: default_value}")
  private String AUTO_TIMING_RESTORE_MESSAGES_INTERVAL;

  public String getAUTO_TIMING_RESTORE_MESSAGES_INTERVAL() {
    return AUTO_TIMING_RESTORE_MESSAGES_INTERVAL;
  }

  @Value("${AUTO_TIMING_RESTORE_MESSAGES_TIMEOUT: default_value}")
  private String AUTO_TIMING_RESTORE_MESSAGES_TIMEOUT;

  public String getAUTO_TIMING_RESTORE_MESSAGES_TIMEOUT() {
    return AUTO_TIMING_RESTORE_MESSAGES_TIMEOUT;
  }

  @Value("${AUTO_PREPARED_DEMO_DATAS: false}")
  private Boolean AUTO_PREPARED_DEMO_DATAS;

  public boolean getAUTO_PREPARED_DEMO_DATAS() {
    return AUTO_PREPARED_DEMO_DATAS;
  }

  @Value("${TOKEN_FOR_SOCKET_VERIFY_ENABLED: false}")
  private Boolean TOKEN_FOR_SOCKET_VERIFY_ENABLED;

  public Boolean getTOKEN_FOR_SOCKET_VERIFY_ENABLED() {
    return TOKEN_FOR_SOCKET_VERIFY_ENABLED;
  }

  @Value("${TOKEN_FOR_FILE_UPLOAD_VERIFY_ENABLED: false}")
  private Boolean TOKEN_FOR_FILE_UPLOAD_VERIFY_ENABLED;

  public Boolean getTOKEN_FOR_FILE_UPLOAD_VERIFY_ENABLED() {
    return TOKEN_FOR_FILE_UPLOAD_VERIFY_ENABLED;
  }

  @Value("${TOKEN_EXPIRE_TIME: 0}")
  private String TOKEN_EXPIRE_TIME;

  public int getTOKEN_EXPIRE_TIME() {
    return CommonUtils.getIntValue("TOKEN_EXPIRE_TIME", 0);
  }

  @Value("${TOKEN_SYMMETRIC_SECRET: default_value}")
  private String TOKEN_SYMMETRIC_SECRET;

  public String getTOKEN_SYMMETRIC_SECRET() {
    return "TOKEN_SYMMETRIC_SECRET";
  }

  @Value("${TOKEN_RSA_PRIVATE_KEY_FILE_PATH: default_value}")
  private String TOKEN_RSA_PRIVATE_KEY_FILE_PATH;

  public String getTOKEN_RSA_PRIVATE_KEY_FILE_PATH() {
    return TOKEN_RSA_PRIVATE_KEY_FILE_PATH;
  }

  @Value("${TOKEN_RSA_PUBLIC_KEY_FILE_PATH: default_value}")
  private String TOKEN_RSA_PUBLIC_KEY_FILE_PATH;

  public String getTOKEN_RSA_PUBLIC_KEY_FILE_PATH() {
    return TOKEN_RSA_PUBLIC_KEY_FILE_PATH;
  }

}
